﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Architect.BLL;
using Architect.CL;
using Architect.DAL;
using Architect.Web.UI;
namespace ArchitectSite.Admin.Article
{
    public partial class Default : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            FormUtil.RedirectAfterUpdate(GridView1, "Article.aspx?page={0}");
            FormUtil.SetPageIndex(GridView1, "page");
            FormUtil.SetDefaultButton((Button)GridViewSearchPanel1.FindControl("cmdSearch"));
        }
        protected void GridView1_SelectedIndexChanged(object sender, EventArgs e)
        {
            string urlParams = string.Format("Id={0}", GridView1.SelectedDataKey.Values[0]);
            Response.Redirect("ArticleEdit.aspx?" + urlParams, true);
        }

        protected void GridView1_RowDeleting(object sender, GridViewDeleteEventArgs e)
        {
            //int id =int.Parse(e.Keys["Id"].ToString());
            //DataRepository.ArticleProvider.Delete(id);
            //GridView1.DeleteRow(e.RowIndex);
        }

        protected void GridView1_RowDeleted(object sender, GridViewDeletedEventArgs e)
        {

        }
    }
}